<template>
	<view>
		<view class="cu-tabbar-height"></view> 
		<view class="cu-bar input foot">
			<view class="action">
				<text class="cuIcon-sound text-grey"></text>
			</view>
			<input @focus="InputFocus" @blur="InputBlur" :adjust-position="false" class="solid-bottom" :focus="false" maxlength="300"
			 cursor-spacing="10" confirm-type="send"></input>
			<view class="action">
				<text class="cuIcon-emojifill text-grey"></text>
			</view>
			<button class="cu-btn bg-green shadow-blur">评论</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {	
				pageHeight: 0,
				windowHeight: 0
			};
		},
		mounted: function() {
			let _this = this;
			if (this.scrollTarget) {
				uni.getSystemInfo({
					success: function(res) {
						_this.windowHeight = res.windowHeight;
					}
				});
				uni.createSelectorQuery()
					.selectAll(this.scrollTarget)
					.boundingClientRect(function(rects) {
						_this.pageHeight = rects[0].height;
					})
					.exec();
				uni.onWindowResize(res => {  
					uni.pageScrollTo({
						//scrollTop: rects[0].height - res.size.windowHeight,
						scrollTop: _this.pageHeight,  
						duration: 500
					});
				});
			}
		},
		methods: {
			InputFocus(e) {
				//this.InputBottom = e.detail.height
			},
			InputBlur(e) {
				// /* this.InputBottom = 0 */
			}
		},
		props: {
			scrollTarget: { //滚动目标
				type: String,
				default: ""
			}
		}
	}
</script>

<style>

</style>
